package com.lyf.design.learn.designmodel.visitor;

import java.util.LinkedList;
import java.util.List;

/**
 * @AUTHOR LYF
 * @DATE 2022/6/11
 * @VERSION 1.0
 * @DESC
 */
public class ElementStructure {
    List<Element> list=new LinkedList<>();

    void visit(Visitor visitor){
        for(Element e:list){
            //
            e.accept(visitor);
        }
    }

    void add(Element element){
        list.add(element);
    }
    void remove(Element element){
        list.remove(element);
    }


}
